﻿using Microsoft.EntityFrameworkCore;
using ConsoleApp10;

namespace WebApplication2
{
    public class OrderContext : DbContext
    {
        public OrderContext(DbContextOptions<OrderContext> options)
         : base(options)
        {
            this.Database.EnsureCreated(); //自动建库建表
        }

        public DbSet<Order> Orders { get; set; } = null!;
    }
}
